package com.tianhui.consignortwofei.mvp.ui.activity;

import android.os.Bundle;
import android.text.TextUtils;
import android.widget.TextView;

import com.fgs.common.CommonFragment;
import com.fgs.common.CommonPresenter;
import com.fgs.common.CommonView;
import com.tianhui.consignortwofei.R;
import com.tianhui.consignortwofei.base.BaseActivity;
import com.tianhui.consignortwofei.constant.KeyValue;
import com.xuexiang.xutil.common.StringUtils;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * @author fgs
 * @date 2020/9/9
 * @description
 **/
public class PaymentSuccessActivity extends BaseActivity {

    @BindView(R.id.activity_payment_success_amountTextView)
    TextView mAmountTextView;

    @Override
    public int getLayoutId() {
        return R.layout.activity_payment_success;
    }

    @Override
    public CommonPresenter createPresenter() {
        return null;
    }

    @Override
    public CommonView createView() {
        return null;
    }

    @Override
    public String getToolbarTitle() {
        return "付款成功";
    }

    @Override
    public void init() {
        Bundle bundle = getIntent().getExtras();
        if (bundle != null && !bundle.isEmpty()) {
            String amount = bundle.getString(KeyValue.KEY_AMOUNT);
            if (!TextUtils.isEmpty(amount)) {
                float amountResult = StringUtils.toFloat(amount) / 100;
                mAmountTextView.setText(amountResult + "");
            }
        }


    }

    @Override
    public CommonFragment createFragment() {
        return null;
    }

    @OnClick(R.id.activity_payment_success_backButton)
    public void goBackHome() {
        openActivity(MainActivity.class);
    }
}
